Xbasic

HTTP_GET_PAGE Function

Deprecated This function has been deprecated. HTTP_GET() should be used as a replacement.

Syntax

Page_Text as C = http_get_page(host as C [,page as C [,port as N]])

Arguments

hostCharacter

The URL of the host computer or page.

pageCharacter

Default = the default page of the website. The page to retrieve.

portNumeric

Default = 80. The port of the website.

Returns

Page_TextCharacter

The HTML text of the selected page.

Description

Gets the contents of a web page.

The HTTP_GET_PAGE() function retrieves returns the full HTML Page including the headers sent by the remote server.

HTTP_GET_PAGE() is not capable of following redirects or handling error responses from a server.
A HTTP GET is different from a HTTP POST in two significant ways. Some devices may restrict the total length of a URL to 128 characters, which may trim the arguments appended by a GET command. There is no such restriction with POST commands. You may save (bookmark) and refresh URLs formatted through a HTTP GET command. The arguments sent by a HTTP POST command are not saved in a bookmark.

Example

page_contents = http_get_page("www.alphasoftware.com")
page_contents = http_get_page("www.alphasoftware.com/products/default.asp")
page_contents = http_get_page("www.alphasoftware.com","/products/default.asp")
page_contents = http_get_page("www.alphasoftware.com","/products/default.asp",80)

See Also